<?php
/**
 * Created by PhpStorm.
 * User: fengzi
 * Date: 2019/5/29
 * Time: 17:18
 */

namespace app\vehicle\model;
use think\Model;

class OrderTpl extends Model
{
    public function order()
    {
        return $this->belongsToMany('Order');
    }
    public function pathway(){
        return $this->hasMany('order_tpl_place','tpl_id','id')->field('id,tpl_id,city_name as city,name as title,dep_date,long,lat,dep_date as date')->order('dep_date asc');
    }

    public function brand(){
        return $this->hasOne('bus_brand','id','brand_id')->bind([
            'brand_name'=>'name'
        ]);
    }
}